package com.codeyang.service.impl;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codeyang.domain.HotSearch;
import com.codeyang.mapper.HotSearchMapper;
import com.codeyang.service.HotSearchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 描述: TO-删除标志-DO
 *
 * @author CodeYang_Site
 * @version 2021/5/26 13:53
 */
@Slf4j
@Service
public class HotSearchServiceImpl extends ServiceImpl<HotSearchMapper, HotSearch> implements HotSearchService {


    /**
     * 新增热搜
     *
     * @param hotSearch
     * @return
     */
    @Override
    public boolean save(HotSearch hotSearch) {
        log.info("新增热搜{}", JSON.toJSONString(hotSearch));
        hotSearch.setRecDate(new Date());
        return super.save(hotSearch);
    }
}
